package com.inscream.app;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;

import com.inscream.app.functionality.InscreamTab;
import com.inscream.app.profileTab.MyNotifications;


public class MainActivity extends TabActivity {

    private static final String HOMEPAGE = "";
    private static final String RECORDZ = "";
    private static final String TRENDLIST = "";
    private static final String PROFILE = "";
    ImageView getMoreDetail;

    TextView openNotifications, inscreamId;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        inscreamId = (TextView) findViewById(R.id.inscreamId);
        openNotifications = (TextView) findViewById(R.id.openNotifications);
        openNotifications.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent openNtf = new Intent(MainActivity.this, MyNotifications.class);
                startActivity(openNtf);
            }
        });
        inscreamId.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent openInscream = new Intent(MainActivity.this, InscreamTab.class);
                startActivity(openInscream);
            }
        });


        // setTitle("Inscream");
        TabHost tabHost = getTabHost();
        // Inbox Tab
        TabHost.TabSpec inboxSpec = tabHost.newTabSpec(HOMEPAGE);
        inboxSpec.setIndicator(HOMEPAGE, getResources().getDrawable(R.drawable.icon_inbox));
        Intent inboxIntent = new Intent(this, HomeActivity.class);
        inboxSpec.setContent(inboxIntent);

        // Outbox Tab
        TabHost.TabSpec outboxSpec = tabHost.newTabSpec(RECORDZ);
        outboxSpec.setIndicator(RECORDZ, getResources().getDrawable(R.drawable.icon_outbox));
        Intent outboxIntent = new Intent(this, RecordActivity.class);
        outboxSpec.setContent(outboxIntent);

        // Tag Tab
        TabHost.TabSpec trendSpec = tabHost.newTabSpec(TRENDLIST);
        trendSpec.setIndicator(TRENDLIST, getResources().getDrawable(R.drawable.tt_list));
        Intent trendIntent = new Intent(this, TrendActivity.class);
        trendSpec.setContent(trendIntent);

        // Profile Tab
        TabHost.TabSpec profileSpec = tabHost.newTabSpec(PROFILE);
        profileSpec.setIndicator(PROFILE, getResources().getDrawable(R.drawable.tt_list));
        Intent profileIntent = new Intent(this, TabTab.class);
        profileSpec.setContent(profileIntent);

        // Adding all TabSpec to TabHost
        tabHost.addTab(inboxSpec); // Adding Inbox tab
        tabHost.addTab(outboxSpec); // Adding Outbox tab
        tabHost.addTab(trendSpec); // Adding Trend tab
        tabHost.addTab(profileSpec); // Adding Profile tab
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}